<template>
  <div class="RefChid">
    RefChild组件
    <button @click="getParent">获取父组件或者根组件的元素</button>
  </div>
</template>
<script>
export default {
  data () {
    return {
      message: 'message消息'
    }
  },
  methods: {
    messageA () {
      console.log('我是子组件的方法。。。。')
    },
    getParent () {
      console.log(this.$parent)
      console.log(this.$root)
    }
  }
}
</script>
<style scoped>
</style>
